package net.area80.utils
{
	import flash.utils.describeType;
	public class TraceObject
	{
		
		public static function toString (o:Object):String {
			var typeXML:XML = describeType(o);
			var s:String = "[Object "+String(typeXML.@name).split("::")[1]+" {";
			var isFirst:Boolean = true;
			for each (var node:XML in typeXML.variable) {
				s +=  ((!isFirst)?", " : "") + [node.@name] + ":" + o[node.@name];
				if (isFirst) isFirst = false;
			}
			s += "}];"
			return s;
		}

	}
}